<?php 
function https_request($url,$data = null){
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
    if (!empty($data)){
        curl_setopt($curl, CURLOPT_POST, 1);
        curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
    }
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    $output = curl_exec($curl);
    curl_close($curl);
    return $output;
}
$access_token = 'JlJ6nB7qTtw38jH2V4HtgegFWgnUleN0gqZzphIyTw4tYJ-R3pCOpOHBkXOY0hFewrYJ4yCZ6Ce1pIhvjjSPth-aQIcoVXs7AF1EE47d6q-EppkQJ_OQXN1MKAxB62RuAEWaAJALPH';

$url = 'https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token='.$access_token;

$data = '{"action_name": "QR_LIMIT_SCENE", "action_info": {"scene": {"scene_id": 123}}}';

// $res = https_request($url,$data);

// file_put_contents('log.txt', $res.'\n',FILE_APPEND);

// $info = json_decode($res);
// $ticket = urlencode($info->ticket);
// $src = 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket='.$ticket;
// var_dump($info);
$res = urlencode('http://www.crazycat.online/index.php/Home/Login/index.html');

$url = 'https://open.weixin.qq.com/connect/qrconnect?appid=wx829fa27ed7eacff5&redirect_uri='.$res.'&response_type=code&scope=snsapi_login&state=STATE#wechat_redirect';
echo $url;
?>


<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<img alt="" src="<?php echo $src;?>">
</body>
</html>